package com.thermofisher.dsc.amanda.customer.controller;

import com.thermofisher.dsc.amanda.common.crud.controller.AbsBaseController;
import com.thermofisher.dsc.amanda.customer.service.ExclusivePriceService;
import com.thermofisher.dsc.amanda.customer.service.ITSCARService;
import com.thermofisher.dsc.amanda.model.dto.customer.ExclusivePriceDto;
import com.thermofisher.dsc.amanda.model.dto.customer.ITSCARDto;
import com.thermofisher.dsc.amanda.model.response.BaseResponse;
import com.thermofisher.dsc.amanda.model.response.DataResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * @author wenjie.yang on 1/3/2019.
 */
@RestController
@RequestMapping("/api/customer/product")
public class ExclusivePriceCntroller extends AbsBaseController<ExclusivePriceService, ExclusivePriceDto> {

    @Autowired
    protected ExclusivePriceService service;

    @Override
    @PostMapping
    public BaseResponse<ExclusivePriceDto> insert(@RequestBody ExclusivePriceDto exclusivePriceDto) {
        return new DataResponse<>(service.create(exclusivePriceDto));
    }

    @Override
//    @GetMapping("/{id}")
    public BaseResponse<ExclusivePriceDto> getById(@PathVariable("id") Long id) {
        return new DataResponse<>(service.getById(id));
    }

}
